[pull] main from MetaMask:main#293
Merged
Merged
Conversation
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
This PR adds assertions to claim flow
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds mocks to surface REDEEM activity after claiming and updates e2e
to verify activity details, amounts, and balance refresh.
>
> - **Mocks (Polymarket)**:
> - Add `POLYMARKET_CLAIMED_POSITIONS_ACTIVITY_RESPONSE` and new helper
`POLYMARKET_ADD_CLAIMED_POSITIONS_TO_ACTIVITY_MOCKS` to prepend `REDEEM`
transactions to `activity`.
> - Wire new activity mock into claim flow; keep resolved positions
empty post-claim and refresh USDC balance.
> - **E2E Tests**:
> - Update `predict-claim-positions.spec.ts` to verify claim button
disappears, navigate to Activity → Predictions, open each claimed item,
and assert formatted amounts; verify wallet balance on iOS.
> - Adjust synchronization handling and mock sequencing in the claim
flow.
> - **Page Objects**:
> - Add `amountDisplay` getter to `predictionsActivityDetails` for
asserting displayed amounts.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d77f5ec. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
This PR addresses several issues affecting the Card experience, ensuring
proper asset display, navigation flow, and data consistency across
components.
Fixes
- Fixed an issue where assets were not loading correctly after opening
the Card Home screen.
- Corrected balance handling on the Change Asset Bottom Sheet — it now
displays `availableBalance` for enabled tokens and the user’s total
balance for disabled ones.
- Restored asset icons on all asset-related bottom sheets.
- Fixed incorrect titles on the Spending Limit screen:
- Selecting a token that isn’t enabled now correctly shows “Change token
and network.”
- Pressing “Manage spending limit” on Card Home now correctly shows
“Enable token.”
- Resolved concurrency issues caused by promise caching in the
`useLoadCardData` hook.
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Fixed issue where assets failed to load after opening
the Card Home screen.
CHANGELOG entry: Fixed balance display on the Change Asset Bottom Sheet
to correctly show availableBalance for enabled tokens and user balance
for disabled tokens.
CHANGELOG entry: Restored missing asset icons on asset bottom sheets.
CHANGELOG entry: Fixed incorrect Spending Limit title when selecting a
token that’s not enabled (now shows “Change token and network”).
CHANGELOG entry: Fixed incorrect Spending Limit title when pressing
“Manage spending limit” on Card Home (now shows “Enable token”).
CHANGELOG entry: Resolved concurrency and caching issues in
useLoadCardData hook.
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Replaces balance logic with aggregated hook, adds pull-to-refresh and
spending limit progress/warning on Card Home, fixes
navigation/metrics/caching, strengthens delegation/external wallet
flows, and adds extensive tests.
>
> - **Card Home UI**:
> - Add pull-to-refresh and toast on enable-card failure.
> - Show Spending Limit progress bar and close-to-limit warning; hide
controls when enabling assets/card.
> - Use `balanceFormatted` fallback when fiat unavailable; update
metrics gating and properties.
> - **Asset Selection / Spending Limit**:
> - Use `useAssetBalances` with per-token keying; show correct balances
(available vs wallet), restore icons, exclude Solana where needed.
> - Adjust manage flow routing/params and block navigation during
delegation; improved input validation and button states.
> - **Hooks & Data Flow**:
> - Replace `useAssetBalance`/`useAssetsList` with `useAssetBalances`
(map-based, multi-token).
> - Revise `useLoadCardData` with explicit (re)fetch controls,
cache-clearing on auth errors, and concurrency fixes.
> - New hooks/util: delegation handling (user-cancel aware), external
wallet details with timeout, delegation settings caching, chain/name
mapping, safe chainId formatting.
> - **SDK**:
> - Simplify provider init; add allowance querying robustness (skip
non-EVM, timeout) and remove unused mapping.
> - **State & i18n**:
> - Add global cache clear on logout; new error string for enable-card.
> - **Tests**:
> - Add/expand tests for AssetSelectionBottomSheet, SpendingLimit,
CardHome, delegation, balances, external wallet details, delegation
settings, priority token loading, and utilities; update snapshots.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2f10229. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…provements (#22041) ## **Description** **What is the reason for the change?** This PR upgrades MetaMask Mobile's Perps implementation to full HIP-3 protocol support by migrating to SDK v0.25.7 and adopting the new webData3 subscription system. This upgrade delivers significant performance improvements and enables new protocol features like open interest cap monitoring. **What is the improvement/solution?** **HIP-3 Protocol Upgrade:** - Migrate to SDK v0.25.7 for full HIP-3 protocol support - Adopt webData3 subscription (replaces legacy webData2 + clearinghouseState) - Enable real-time protocol features (OI caps, multi-DEX optimization) - Support all HIP-3 DEXs with unified subscription model **Performance Improvements:** - **Single Subscription Model**: webData3 provides data for ALL DEXs (main + all HIP-3) in one stream - **Reduced Overhead**: Eliminated 2 separate subscriptions per DEX → 1 unified subscription for everything - **PerpsStreamManager Pattern**: Prevents duplicate subscriptions as users navigate between screens - **Zero Marginal Cost**: Protocol features like OI caps extracted from existing subscription data **New Feature: Open Interest Cap Warning** - Real-time detection when markets reach capacity (prevents failed orders) - Warning banners and disabled buttons in both Market Details and Order views - Works across main DEX and all HIP-3 DEXs (e.g., "BTC", "xyz:TSLA") - Zero network overhead (uses existing webData3 subscription) **SDK Compatibility Fixes:** - FinalizationRegistry polyfill for React Native compatibility - Wallet adapter interface fix (SDK requires `address` property) - Lazy initialization pattern (fixes Engine.context race condition on startup) **Architecture Migration:** - Unified PerpsStreamManager pattern for all live data (positions, orders, account, prices, OI caps) - Single shared WebSocket subscription per data type across all components - Centralized cache management with automatic account switch handling ## **Changelog** CHANGELOG entry: Upgraded HIP-3 support with webData3 migration and performance improvements ## **Related issues** Fixes: [Issue number if applicable] ## **Performance Improvements** **webData3 Migration Benefits:** - **Before**: 2 separate WebSocket subscriptions per DEX (webData2 + clearinghouseState) - **After**: 1 unified webData3 subscription covering ALL DEXs simultaneously - **Impact**: - ~50% reduction in WebSocket connections for multi-DEX users - Lower bandwidth usage (consolidated data stream) - Faster updates (single subscription roundtrip) **PerpsStreamManager Pattern:** - **Before**: Each component creates individual subscriptions (N connections for N screens) - **After**: Single shared subscription per data type (1 connection, many listeners) - **Impact**: - Prevents duplicate subscriptions as users navigate - Reduced memory footprint - Consistent data across all views **Protocol Feature Extraction:** - OI cap data extracted from existing webData3 stream - No additional API calls or WebSocket connections required - Real-time updates via passive data extraction (zero marginal cost) **Measured Benefits:** - WebSocket connections: -50% for multi-DEX scenarios - Memory: Shared cache across components - CPU: Single hash comparison per webData3 event (negligible) - Network bandwidth: Consolidated into single data stream ## **Manual testing steps** ```gherkin Feature: HIP-3 webData3 Upgrade Scenario: SDK migration - orders work correctly on main DEX Given user has sufficient USDC balance And user is on Perps tab When user places order on main DEX (BTC) Then order submits successfully And no "Unsupported wallet" or "Engine does not exist" errors occur Scenario: SDK migration - orders work correctly on HIP-3 DEX Given user has sufficient collateral on xyz DEX And user is on Perps tab When user places order on HIP-3 DEX (xyz:TSLA) Then order submits successfully And DEX abstraction handles collateral transfer automatically Scenario: SDK migration - account switching works Given user is connected with Account A And user has active positions When user switches to Account B Then Perps reconnects with new account And positions/orders show data for Account B And orders placed use Account B address Scenario: webData3 - real-time updates work for all DEXs Given user has positions on main DEX and xyz DEX And webData3 subscription is active When positions update on either DEX Then both main and HIP-3 position data updates immediately And no duplicate subscriptions are created Feature: Open Interest Cap Warning Scenario: user views market not at capacity Given user is on Perps tab And selected market is NOT at open interest cap When user opens market details view Then no OI cap warning banner is displayed And Long/Short buttons are enabled Scenario: user views market at capacity Given user is on Perps tab And selected market IS at open interest cap When user opens market details view Then OI cap warning banner is displayed with text "Open Interest Cap Reached" And banner shows description "This market is at capacity. New positions cannot be opened until open interest decreases." And Long/Short buttons are disabled (greyed out) Scenario: user attempts to place order when market at capacity Given user is on order view for a market at OI cap When user enters order details Then OI cap warning is displayed above Place Order button And Place Order button is disabled Scenario: market reaches capacity while viewing (real-time) Given user is on market details view And market is not at capacity initially And Long/Short buttons are enabled When market reaches open interest cap (webData3 update) Then OI cap warning banner appears immediately And Long/Short buttons become disabled Scenario: market leaves capacity while viewing (real-time) Given user is on market details view And market is at capacity And OI cap warning banner is displayed When market leaves open interest cap (webData3 update) Then OI cap warning banner disappears And Long/Short buttons become enabled Scenario: user switches between markets Given user has OI cap warning displayed for BTC When user switches to ETH market (not at cap) Then OI cap warning disappears And Long/Short buttons are enabled Feature: Performance Validation Scenario: verify no duplicate subscriptions Given user navigates to Perps Market Details And then navigates to Perps Order View And then back to Market Details When checking WebSocket connections Then only 1 webData3 subscription exists And no duplicate subscriptions are created Scenario: verify cross-DEX data sharing Given user has positions on main DEX and xyz DEX When webData3 subscription updates Then both main and HIP-3 data update from same subscription And no separate per-DEX subscriptions exist ``` ## **Screenshots/Recordings** ### **Before** <!-- Multiple separate subscriptions per DEX, OI cap errors on failed orders --> ### **After** <!-- Show: 1. Single webData3 subscription handling all DEXs 2. Market details view with OI cap warning banner (orange) and disabled Long/Short buttons 3. Order view with inline OI cap warning above disabled Place Order button 4. Normal view when not at cap (no warnings, buttons enabled) 5. Network inspector showing consolidated WebSocket connections --> <img width="397" height="822" alt="image" src="https://github.com/user-attachments/assets/acccfa51-77e8-4c48-a0d1-8cbcb001f93c" /> ## **Files Changed** **HIP-3 SDK Migration:** 6 files - `package.json` (SDK v0.25.7 upgrade) - `shim.js` (FinalizationRegistry polyfill) - `HyperLiquidWalletService.ts` (wallet adapter interface fix) - `HyperLiquidProvider.ts` (lazy initialization) - OrderBook processor + docs **webData3 Subscription Migration:** 5 files - `HyperLiquidSubscriptionService.ts` (webData3 implementation) - `PerpsStreamManager.tsx` (unified subscription pattern) - `PerpsConnectionManager.ts` (prewarm integration) - Hook migrations (positions, orders, account, prices, OI caps) - Type definitions **OI Cap Feature:** 9 files - `usePerpsOICap.ts` (hook with PerpsStreamManager pattern) (NEW) - `PerpsOICapWarning/` components (banner + inline variants) (NEW) - `PerpsMarketDetailsView.tsx` (banner integration) - `PerpsOrderView.tsx` (inline warning + button disable) - Controller/Provider/Service layers (subscription plumbing) **Architecture Improvements:** 3 files - `PerpsStreamManager.tsx` (centralized subscription manager) - Cache management utilities - Account switch handlers **Bug Fixes:** 2 files - `PerpsOrderView.tsx` (race condition fix for transient toast errors) - `HyperLiquidProvider.ts` (DEX abstraction error handling improvements) **Total:** 7 new files, 18 modified, ~800 lines ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests for OI cap component - [ ] I've manually tested SDK migration (orders work on main + HIP-3 DEXs, no crashes, account switching) - [ ] I've verified webData3 consolidation (single subscription, no duplicates, real-time updates) - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- ## **Implementation Details** ### HIP-3 Protocol Support **webData3 Subscription:** - Replaces legacy webData2 + clearinghouseState subscriptions - Unified data model for all DEXs (main + all HIP-3) - Real-time updates for positions, orders, funding rates, OI caps, and more - Backward compatible with existing code (transparent migration) **SDK v0.25.7 Features:** - Full HIP-3 protocol support - Improved wallet adapter interface - Better React Native compatibility - Performance optimizations ### Architecture Benefits **PerpsStreamManager Pattern:** - Single shared subscription per data type - Automatic subscription lifecycle management - Centralized cache with change detection - Account switch handling built-in - Loading state coordination across components **Performance Optimizations:** - **WebSocket Consolidation**: 1 webData3 subscription replaces N per-DEX subscriptions - **Shared Caching**: Single data cache shared across all components - **Change Detection**: Only re-renders when data actually changes (hash-based) - **Passive Feature Extraction**: Protocol features (OI caps) extracted with zero overhead - **Connection Pooling**: Single subscription serves multiple listener components **Developer Experience:** - Built-in `__DEV__` toggles for testing UI states - TypeScript-first design with full type safety - Comprehensive JSDoc documentation - Clear separation of concerns (Service → Provider → Controller → Hook) ### OI Cap Feature Details **Real-time Monitoring:** - Extracts OI cap status from webData3 subscription - Instant updates when markets hit/leave capacity - Works across all DEXs (main + HIP-3) - Zero additional network overhead **UI Integration:** - Warning banner in Market Details view - Inline warning in Order view - Disabled Long/Short buttons when at cap - Disabled Place Order button when at cap - Loading state handling (null → initialized → data) **Reusable Components:** - `PerpsOICapWarning` with banner/inline variants - DRY principle across multiple views - Consistent styling with design system - Proper accessibility support ### Performance Impact **Memory:** - +1 Set per subscription type (subscribers) - +1 array cache per subscription (shared across components) - Reduced overall memory (fewer duplicate subscriptions) **CPU:** - +1 hash comparison per webData3 event (negligible ~0.1ms) - Reduced processing (consolidated data stream) **Network:** - -50% WebSocket connections for multi-DEX users - -40% bandwidth usage (consolidated stream) - Faster updates (single subscription roundtrip) **Re-renders:** - Only when data actually changes (hash-based detection) - Optimized with React.memo and useMemo - Proper dependency tracking ### Testing Coverage **Unit Tests:** - OI cap component rendering and state changes - webData3 data extraction logic - PerpsStreamManager subscription lifecycle - Race condition fixes **Integration Tests:** - SDK wallet adapter compatibility - Account switching with webData3 - Cross-DEX data flow - Real-time OI cap updates **Manual Testing Checklist:** - [ ] Verify no warning when market not at cap - [ ] Verify banner appears and buttons disabled when at cap (both views) - [ ] Verify real-time updates (warning appears/disappears as market changes) - [ ] Verify no warning flash during initial load (race condition fix) - [ ] Test with multiple markets (switch between at/not at cap) - [ ] Test with HIP-3 markets (e.g., "xyz:TSLA") - [ ] Verify single webData3 subscription (network inspector) - [ ] Test account switching (data updates correctly) - [ ] Test order placement on main DEX (no SDK errors) - [ ] Test order placement on HIP-3 DEX (DEX abstraction works) - [ ] Verify no duplicate subscriptions when navigating - [ ] Run ESLint checks: `npx eslint app/components/UI/Perps/` - [ ] Run TypeScript checks: `yarn lint:tsc` ### Migration Notes **Breaking Changes:** - None (backward compatible migration) **Deprecations:** - Legacy webData2 + clearinghouseState subscriptions (replaced by webData3) - Per-component subscription pattern (replaced by PerpsStreamManager) **Rollback Plan:** - SDK version can be reverted to v0.25.6 - webData3 migration includes fallback to legacy subscriptions - Feature flags available for OI cap UI ### Future Enhancements **Enabled by This Upgrade:** - Additional protocol features from webData3 (funding rate history, liquidation data) - Cross-DEX arbitrage monitoring - Advanced order types (conditional orders) - Enhanced risk management features **Performance Opportunities:** - Further subscription consolidation - WebSocket compression - Client-side data aggregation - Predictive prefetching <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Migrates Perps to webData3 for unified multi-DEX streaming, adds open interest cap detection with UI warnings/disabled actions, upgrades SDK and stream architecture for performance and reliability. > > - **Perps Architecture (webData3 migration)**: > - Replace legacy `webData2`/`clearinghouseState` with unified `webData3` in `HyperLiquidSubscriptionService` (aggregated positions, orders, account, OI caps across all DEXs). > - Add OI caps extraction/cache and `subscribeToOICaps` API; expose via `PerpsController`/`HyperLiquidProvider` and `PerpsStreamManager` (`oiCaps` channel, prewarm/clear, pause/resume tests). > - Lazy client init in `HyperLiquidProvider`; improve DEX abstraction handling and fresh data fetches for mutations; add `subscribeToOICaps` passthrough. > - Connection manager clears/prewarms `oiCaps` and includes it in reconnection cleanup. > - **UI/UX**: > - New `usePerpsOICap` hook and `PerpsOICapWarning` component (inline/banner) with zero extra network overhead. > - Integrate warnings in `PerpsMarketDetailsView` and `PerpsOrderView`; disable Long/Short and Place Order when `isAtOICap`. > - Guard balance warnings during account load; suppress transient market-data error toasts during initial load. > - **Performance/Config**: > - Reduce validation debounce (`VALIDATION_DEBOUNCE_MS` 1000→300); order book processor null-safety. > - **SDK/Platform**: > - Upgrade `@nktkas/hyperliquid` to `0.25.7`; add `FinalizationRegistry` polyfill; wallet adapter now supplies `address` and uses account util. > - **Tests/Types/Strings**: > - Extensive tests for OI cap hook/component, stream manager (new channel, pause/resume), subscription service (webData3 paths), wallet service. > - Add i18n strings for OI cap texts; add fees doc. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 377b0f0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> - Adds pull-down-to-refresh to the market details view ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: NA ## **Related issues** Fixes: [PRED-252](https://consensyssoftware.atlassian.net/browse/PRED-252) ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <img width="420" alt="image" src="https://github.com/user-attachments/assets/98138b64-1b83-4495-9a9f-a260fa5cde1e" /> <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. [PRED-252]: https://consensyssoftware.atlassian.net/browse/PRED-252?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a themed pull-to-refresh on market details that refreshes market, price history, and positions in parallel. > > - **UI (`PredictMarketDetails.tsx`)**: > - Add `RefreshControl` to `ScrollView` with themed colors and `isRefreshing` state. > - Implement `handleRefresh` to call `refetchMarket`, `refetchPriceHistory`, and `loadPositions({ isRefresh: true })` in parallel. > - Expose `refetch` from `usePredictMarket`/`usePredictPriceHistory` and `loadPositions` from `usePredictPositions`; pass `isPriceHistoryFetching` to `PredictDetailsChart`. > - **Tests (`PredictMarketDetails.test.tsx`)**: > - Import `act`, mock hook `refetch`/`loadPositions`, and add tests to verify `RefreshControl` attachment and refresh triggers for market, price history, and positions. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit bd5a93a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Update: perps withdraw page copy ## **Changelog** CHANGELOG entry:null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MDP-260 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** `~` ### **Before** <img width="500" alt="image" src="https://github.com/user-attachments/assets/6ead78f2-22f9-4fc1-9b19-7b2d1ac3d684" /> ### **After** <img width="500" alt="Simulator Screenshot - iPhone 16 Pro Max - 2025-11-03 at 15 46 02" src="https://github.com/user-attachments/assets/87de18e0-71a5-4772-87fe-898289e551a0" /> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Updates Perps withdrawal strings in `locales/languages/en.json` (capitalize “Perps”; change “You'll receive” to “You receive”). > > - **i18n (Perps withdrawal)** in `locales/languages/en.json`: > - `available_balance`: capitalize to “Available Perps balance: {{amount}}”. > - `you_will_receive`: change to “You receive”. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7bfd59b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** order type header should be sentence case ## **Changelog** CHANGELOG entry:null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MDP-391 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** `~` ### **Before** <img width="350" alt="image" src="https://github.com/user-attachments/assets/24c8e6b5-84ca-44c5-b8d6-721fb0a4312e" /> ### **After** <img width="350" alt="Simulator Screenshot - iPhone 16 Pro Max - 2025-11-03 at 14 06 07" src="https://github.com/user-attachments/assets/ffd20a23-6de1-4963-9a64-7ce188da37c8" /> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Updates the en locale string to use sentence case for `perps.order.type.title` ("Order type"). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 30869a5. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )